#pragma once

#include <base/macro/aeval.h>

/* 0-255的加减运算 */
#define INC8(x)		__INC8(x)
#define __INC8(x)	__MCAT(__INC8_,x) //__INC8_##x

#define DEC8(x)		__DEC8(x)
#define __DEC8(x)	__MCAT(__DEC8_,x) //__DEC8_##x

/*  INC真值表   */
#define __INC8_0	1
#define __INC8_1	2
#define __INC8_2	3
#define __INC8_3	4
#define __INC8_4	5
#define __INC8_5	6
#define __INC8_6	7
#define __INC8_7	8
#define __INC8_8	9
#define __INC8_9	10
#define __INC8_10	11
#define __INC8_11	12
#define __INC8_12	13
#define __INC8_13	14
#define __INC8_14	15
#define __INC8_15	16
#define __INC8_16	17
#define __INC8_17	18
#define __INC8_18	19
#define __INC8_19	20
#define __INC8_20	21
#define __INC8_21	22
#define __INC8_22	23
#define __INC8_23	24
#define __INC8_24	25
#define __INC8_25	26
#define __INC8_26	27
#define __INC8_27	28
#define __INC8_28	29
#define __INC8_29	30
#define __INC8_30	31
#define __INC8_31	32
#define __INC8_32	33
#define __INC8_33	34
#define __INC8_34	35
#define __INC8_35	36
#define __INC8_36	37
#define __INC8_37	38
#define __INC8_38	39
#define __INC8_39	40
#define __INC8_40	41
#define __INC8_41	42
#define __INC8_42	43
#define __INC8_43	44
#define __INC8_44	45
#define __INC8_45	46
#define __INC8_46	47
#define __INC8_47	48
#define __INC8_48	49
#define __INC8_49	50
#define __INC8_50	51
#define __INC8_51	52
#define __INC8_52	53
#define __INC8_53	54
#define __INC8_54	55
#define __INC8_55	56
#define __INC8_56	57
#define __INC8_57	58
#define __INC8_58	59
#define __INC8_59	60
#define __INC8_60	61
#define __INC8_61	62
#define __INC8_62	63
#define __INC8_63	64
#define __INC8_64	65
#define __INC8_65	66
#define __INC8_66	67
#define __INC8_67	68
#define __INC8_68	69
#define __INC8_69	70
#define __INC8_70	71
#define __INC8_71	72
#define __INC8_72	73
#define __INC8_73	74
#define __INC8_74	75
#define __INC8_75	76
#define __INC8_76	77
#define __INC8_77	78
#define __INC8_78	79
#define __INC8_79	80
#define __INC8_80	81
#define __INC8_81	82
#define __INC8_82	83
#define __INC8_83	84
#define __INC8_84	85
#define __INC8_85	86
#define __INC8_86	87
#define __INC8_87	88
#define __INC8_88	89
#define __INC8_89	90
#define __INC8_90	91
#define __INC8_91	92
#define __INC8_92	93
#define __INC8_93	94
#define __INC8_94	95
#define __INC8_95	96
#define __INC8_96	97
#define __INC8_97	98
#define __INC8_98	99
#define __INC8_99	100
#define __INC8_100	101
#define __INC8_101	102
#define __INC8_102	103
#define __INC8_103	104
#define __INC8_104	105
#define __INC8_105	106
#define __INC8_106	107
#define __INC8_107	108
#define __INC8_108	109
#define __INC8_109	110
#define __INC8_110	111
#define __INC8_111	112
#define __INC8_112	113
#define __INC8_113	114
#define __INC8_114	115
#define __INC8_115	116
#define __INC8_116	117
#define __INC8_117	118
#define __INC8_118	119
#define __INC8_119	120
#define __INC8_120	121
#define __INC8_121	122
#define __INC8_122	123
#define __INC8_123	124
#define __INC8_124	125
#define __INC8_125	126
#define __INC8_126	127
#define __INC8_127	128
#define __INC8_128	129
#define __INC8_129	130
#define __INC8_130	131
#define __INC8_131	132
#define __INC8_132	133
#define __INC8_133	134
#define __INC8_134	135
#define __INC8_135	136
#define __INC8_136	137
#define __INC8_137	138
#define __INC8_138	139
#define __INC8_139	140
#define __INC8_140	141
#define __INC8_141	142
#define __INC8_142	143
#define __INC8_143	144
#define __INC8_144	145
#define __INC8_145	146
#define __INC8_146	147
#define __INC8_147	148
#define __INC8_148	149
#define __INC8_149	150
#define __INC8_150	151
#define __INC8_151	152
#define __INC8_152	153
#define __INC8_153	154
#define __INC8_154	155
#define __INC8_155	156
#define __INC8_156	157
#define __INC8_157	158
#define __INC8_158	159
#define __INC8_159	160
#define __INC8_160	161
#define __INC8_161	162
#define __INC8_162	163
#define __INC8_163	164
#define __INC8_164	165
#define __INC8_165	166
#define __INC8_166	167
#define __INC8_167	168
#define __INC8_168	169
#define __INC8_169	170
#define __INC8_170	171
#define __INC8_171	172
#define __INC8_172	173
#define __INC8_173	174
#define __INC8_174	175
#define __INC8_175	176
#define __INC8_176	177
#define __INC8_177	178
#define __INC8_178	179
#define __INC8_179	180
#define __INC8_180	181
#define __INC8_181	182
#define __INC8_182	183
#define __INC8_183	184
#define __INC8_184	185
#define __INC8_185	186
#define __INC8_186	187
#define __INC8_187	188
#define __INC8_188	189
#define __INC8_189	190
#define __INC8_190	191
#define __INC8_191	192
#define __INC8_192	193
#define __INC8_193	194
#define __INC8_194	195
#define __INC8_195	196
#define __INC8_196	197
#define __INC8_197	198
#define __INC8_198	199
#define __INC8_199	200
#define __INC8_200	201
#define __INC8_201	202
#define __INC8_202	203
#define __INC8_203	204
#define __INC8_204	205
#define __INC8_205	206
#define __INC8_206	207
#define __INC8_207	208
#define __INC8_208	209
#define __INC8_209	210
#define __INC8_210	211
#define __INC8_211	212
#define __INC8_212	213
#define __INC8_213	214
#define __INC8_214	215
#define __INC8_215	216
#define __INC8_216	217
#define __INC8_217	218
#define __INC8_218	219
#define __INC8_219	220
#define __INC8_220	221
#define __INC8_221	222
#define __INC8_222	223
#define __INC8_223	224
#define __INC8_224	225
#define __INC8_225	226
#define __INC8_226	227
#define __INC8_227	228
#define __INC8_228	229
#define __INC8_229	230
#define __INC8_230	231
#define __INC8_231	232
#define __INC8_232	233
#define __INC8_233	234
#define __INC8_234	235
#define __INC8_235	236
#define __INC8_236	237
#define __INC8_237	238
#define __INC8_238	239
#define __INC8_239	240
#define __INC8_240	241
#define __INC8_241	242
#define __INC8_242	243
#define __INC8_243	244
#define __INC8_244	245
#define __INC8_245	246
#define __INC8_246	247
#define __INC8_247	248
#define __INC8_248	249
#define __INC8_249	250
#define __INC8_250	251
#define __INC8_251	252
#define __INC8_252	253
#define __INC8_253	254
#define __INC8_254	255
#define __INC8_255	0

/*  DEC真值表   */
#define __DEC8_0	255
#define __DEC8_1	0
#define __DEC8_2	1
#define __DEC8_3	2
#define __DEC8_4	3
#define __DEC8_5	4
#define __DEC8_6	5
#define __DEC8_7	6
#define __DEC8_8	7
#define __DEC8_9	8
#define __DEC8_10	9
#define __DEC8_11	10
#define __DEC8_12	11
#define __DEC8_13	12
#define __DEC8_14	13
#define __DEC8_15	14
#define __DEC8_16	15
#define __DEC8_17	16
#define __DEC8_18	17
#define __DEC8_19	18
#define __DEC8_20	19
#define __DEC8_21	20
#define __DEC8_22	21
#define __DEC8_23	22
#define __DEC8_24	23
#define __DEC8_25	24
#define __DEC8_26	25
#define __DEC8_27	26
#define __DEC8_28	27
#define __DEC8_29	28
#define __DEC8_30	29
#define __DEC8_31	30
#define __DEC8_32	31
#define __DEC8_33	32
#define __DEC8_34	33
#define __DEC8_35	34
#define __DEC8_36	35
#define __DEC8_37	36
#define __DEC8_38	37
#define __DEC8_39	38
#define __DEC8_40	39
#define __DEC8_41	40
#define __DEC8_42	41
#define __DEC8_43	42
#define __DEC8_44	43
#define __DEC8_45	44
#define __DEC8_46	45
#define __DEC8_47	46
#define __DEC8_48	47
#define __DEC8_49	48
#define __DEC8_50	49
#define __DEC8_51	50
#define __DEC8_52	51
#define __DEC8_53	52
#define __DEC8_54	53
#define __DEC8_55	54
#define __DEC8_56	55
#define __DEC8_57	56
#define __DEC8_58	57
#define __DEC8_59	58
#define __DEC8_60	59
#define __DEC8_61	60
#define __DEC8_62	61
#define __DEC8_63	62
#define __DEC8_64	63
#define __DEC8_65	64
#define __DEC8_66	65
#define __DEC8_67	66
#define __DEC8_68	67
#define __DEC8_69	68
#define __DEC8_70	69
#define __DEC8_71	70
#define __DEC8_72	71
#define __DEC8_73	72
#define __DEC8_74	73
#define __DEC8_75	74
#define __DEC8_76	75
#define __DEC8_77	76
#define __DEC8_78	77
#define __DEC8_79	78
#define __DEC8_80	79
#define __DEC8_81	80
#define __DEC8_82	81
#define __DEC8_83	82
#define __DEC8_84	83
#define __DEC8_85	84
#define __DEC8_86	85
#define __DEC8_87	86
#define __DEC8_88	87
#define __DEC8_89	88
#define __DEC8_90	89
#define __DEC8_91	90
#define __DEC8_92	91
#define __DEC8_93	92
#define __DEC8_94	93
#define __DEC8_95	94
#define __DEC8_96	95
#define __DEC8_97	96
#define __DEC8_98	97
#define __DEC8_99	98
#define __DEC8_100	99
#define __DEC8_101	100
#define __DEC8_102	101
#define __DEC8_103	102
#define __DEC8_104	103
#define __DEC8_105	104
#define __DEC8_106	105
#define __DEC8_107	106
#define __DEC8_108	107
#define __DEC8_109	108
#define __DEC8_110	109
#define __DEC8_111	110
#define __DEC8_112	111
#define __DEC8_113	112
#define __DEC8_114	113
#define __DEC8_115	114
#define __DEC8_116	115
#define __DEC8_117	116
#define __DEC8_118	117
#define __DEC8_119	118
#define __DEC8_120	119
#define __DEC8_121	120
#define __DEC8_122	121
#define __DEC8_123	122
#define __DEC8_124	123
#define __DEC8_125	124
#define __DEC8_126	125
#define __DEC8_127	126
#define __DEC8_128	127
#define __DEC8_129	128
#define __DEC8_130	129
#define __DEC8_131	130
#define __DEC8_132	131
#define __DEC8_133	132
#define __DEC8_134	133
#define __DEC8_135	134
#define __DEC8_136	135
#define __DEC8_137	136
#define __DEC8_138	137
#define __DEC8_139	138
#define __DEC8_140	139
#define __DEC8_141	140
#define __DEC8_142	141
#define __DEC8_143	142
#define __DEC8_144	143
#define __DEC8_145	144
#define __DEC8_146	145
#define __DEC8_147	146
#define __DEC8_148	147
#define __DEC8_149	148
#define __DEC8_150	149
#define __DEC8_151	150
#define __DEC8_152	151
#define __DEC8_153	152
#define __DEC8_154	153
#define __DEC8_155	154
#define __DEC8_156	155
#define __DEC8_157	156
#define __DEC8_158	157
#define __DEC8_159	158
#define __DEC8_160	159
#define __DEC8_161	160
#define __DEC8_162	161
#define __DEC8_163	162
#define __DEC8_164	163
#define __DEC8_165	164
#define __DEC8_166	165
#define __DEC8_167	166
#define __DEC8_168	167
#define __DEC8_169	168
#define __DEC8_170	169
#define __DEC8_171	170
#define __DEC8_172	171
#define __DEC8_173	172
#define __DEC8_174	173
#define __DEC8_175	174
#define __DEC8_176	175
#define __DEC8_177	176
#define __DEC8_178	177
#define __DEC8_179	178
#define __DEC8_180	179
#define __DEC8_181	180
#define __DEC8_182	181
#define __DEC8_183	182
#define __DEC8_184	183
#define __DEC8_185	184
#define __DEC8_186	185
#define __DEC8_187	186
#define __DEC8_188	187
#define __DEC8_189	188
#define __DEC8_190	189
#define __DEC8_191	190
#define __DEC8_192	191
#define __DEC8_193	192
#define __DEC8_194	193
#define __DEC8_195	194
#define __DEC8_196	195
#define __DEC8_197	196
#define __DEC8_198	197
#define __DEC8_199	198
#define __DEC8_200	199
#define __DEC8_201	200
#define __DEC8_202	201
#define __DEC8_203	202
#define __DEC8_204	203
#define __DEC8_205	204
#define __DEC8_206	205
#define __DEC8_207	206
#define __DEC8_208	207
#define __DEC8_209	208
#define __DEC8_210	209
#define __DEC8_211	210
#define __DEC8_212	211
#define __DEC8_213	212
#define __DEC8_214	213
#define __DEC8_215	214
#define __DEC8_216	215
#define __DEC8_217	216
#define __DEC8_218	217
#define __DEC8_219	218
#define __DEC8_220	219
#define __DEC8_221	220
#define __DEC8_222	221
#define __DEC8_223	222
#define __DEC8_224	223
#define __DEC8_225	224
#define __DEC8_226	225
#define __DEC8_227	226
#define __DEC8_228	227
#define __DEC8_229	228
#define __DEC8_230	229
#define __DEC8_231	230
#define __DEC8_232	231
#define __DEC8_233	232
#define __DEC8_234	233
#define __DEC8_235	234
#define __DEC8_236	235
#define __DEC8_237	236
#define __DEC8_238	237
#define __DEC8_239	238
#define __DEC8_240	239
#define __DEC8_241	240
#define __DEC8_242	241
#define __DEC8_243	242
#define __DEC8_244	243
#define __DEC8_245	244
#define __DEC8_246	245
#define __DEC8_247	246
#define __DEC8_248	247
#define __DEC8_249	248
#define __DEC8_250	249
#define __DEC8_251	250
#define __DEC8_252	251
#define __DEC8_253	252
#define __DEC8_254	253
#define __DEC8_255	254

/* 相等运算? */
#define EQ8(x, y)	IS_PAREN(__EQ8(x, y))

#define __EQ8(x, y)	__EQ8_##x##_##y


#define __EQ8_0_0	()
#define __EQ8_1_1	()
#define __EQ8_2_2	()
#define __EQ8_3_3	()
#define __EQ8_4_4	()
#define __EQ8_5_5	()
#define __EQ8_6_6	()
#define __EQ8_7_7	()
#define __EQ8_8_8	()
#define __EQ8_9_9	()
#define __EQ8_10_10	()
#define __EQ8_11_11	()
#define __EQ8_12_12	()
#define __EQ8_13_13	()
#define __EQ8_14_14	()
#define __EQ8_15_15	()
#define __EQ8_16_16	()
#define __EQ8_17_17	()
#define __EQ8_18_18	()
#define __EQ8_19_19	()
#define __EQ8_20_20	()
#define __EQ8_21_21	()
#define __EQ8_22_22	()
#define __EQ8_23_23	()
#define __EQ8_24_24	()
#define __EQ8_25_25	()
#define __EQ8_26_26	()
#define __EQ8_27_27	()
#define __EQ8_28_28	()
#define __EQ8_29_29	()
#define __EQ8_30_30	()
#define __EQ8_31_31	()
#define __EQ8_32_32	()
#define __EQ8_33_33	()
#define __EQ8_34_34	()
#define __EQ8_35_35	()
#define __EQ8_36_36	()
#define __EQ8_37_37	()
#define __EQ8_38_38	()
#define __EQ8_39_39	()
#define __EQ8_40_40	()
#define __EQ8_41_41	()
#define __EQ8_42_42	()
#define __EQ8_43_43	()
#define __EQ8_44_44	()
#define __EQ8_45_45	()
#define __EQ8_46_46	()
#define __EQ8_47_47	()
#define __EQ8_48_48	()
#define __EQ8_49_49	()
#define __EQ8_50_50	()
#define __EQ8_51_51	()
#define __EQ8_52_52	()
#define __EQ8_53_53	()
#define __EQ8_54_54	()
#define __EQ8_55_55	()
#define __EQ8_56_56	()
#define __EQ8_57_57	()
#define __EQ8_58_58	()
#define __EQ8_59_59	()
#define __EQ8_60_60	()
#define __EQ8_61_61	()
#define __EQ8_62_62	()
#define __EQ8_63_63	()
#define __EQ8_64_64	()
#define __EQ8_65_65	()
#define __EQ8_66_66	()
#define __EQ8_67_67	()
#define __EQ8_68_68	()
#define __EQ8_69_69	()
#define __EQ8_70_70	()
#define __EQ8_71_71	()
#define __EQ8_72_72	()
#define __EQ8_73_73	()
#define __EQ8_74_74	()
#define __EQ8_75_75	()
#define __EQ8_76_76	()
#define __EQ8_77_77	()
#define __EQ8_78_78	()
#define __EQ8_79_79	()
#define __EQ8_80_80	()
#define __EQ8_81_81	()
#define __EQ8_82_82	()
#define __EQ8_83_83	()
#define __EQ8_84_84	()
#define __EQ8_85_85	()
#define __EQ8_86_86	()
#define __EQ8_87_87	()
#define __EQ8_88_88	()
#define __EQ8_89_89	()
#define __EQ8_90_90	()
#define __EQ8_91_91	()
#define __EQ8_92_92	()
#define __EQ8_93_93	()
#define __EQ8_94_94	()
#define __EQ8_95_95	()
#define __EQ8_96_96	()
#define __EQ8_97_97	()
#define __EQ8_98_98	()
#define __EQ8_99_99	()
#define __EQ8_100_100	()
#define __EQ8_101_101	()
#define __EQ8_102_102	()
#define __EQ8_103_103	()
#define __EQ8_104_104	()
#define __EQ8_105_105	()
#define __EQ8_106_106	()
#define __EQ8_107_107	()
#define __EQ8_108_108	()
#define __EQ8_109_109	()
#define __EQ8_110_110	()
#define __EQ8_111_111	()
#define __EQ8_112_112	()
#define __EQ8_113_113	()
#define __EQ8_114_114	()
#define __EQ8_115_115	()
#define __EQ8_116_116	()
#define __EQ8_117_117	()
#define __EQ8_118_118	()
#define __EQ8_119_119	()
#define __EQ8_120_120	()
#define __EQ8_121_121	()
#define __EQ8_122_122	()
#define __EQ8_123_123	()
#define __EQ8_124_124	()
#define __EQ8_125_125	()
#define __EQ8_126_126	()
#define __EQ8_127_127	()
#define __EQ8_128_128	()
#define __EQ8_129_129	()
#define __EQ8_130_130	()
#define __EQ8_131_131	()
#define __EQ8_132_132	()
#define __EQ8_133_133	()
#define __EQ8_134_134	()
#define __EQ8_135_135	()
#define __EQ8_136_136	()
#define __EQ8_137_137	()
#define __EQ8_138_138	()
#define __EQ8_139_139	()
#define __EQ8_140_140	()
#define __EQ8_141_141	()
#define __EQ8_142_142	()
#define __EQ8_143_143	()
#define __EQ8_144_144	()
#define __EQ8_145_145	()
#define __EQ8_146_146	()
#define __EQ8_147_147	()
#define __EQ8_148_148	()
#define __EQ8_149_149	()
#define __EQ8_150_150	()
#define __EQ8_151_151	()
#define __EQ8_152_152	()
#define __EQ8_153_153	()
#define __EQ8_154_154	()
#define __EQ8_155_155	()
#define __EQ8_156_156	()
#define __EQ8_157_157	()
#define __EQ8_158_158	()
#define __EQ8_159_159	()
#define __EQ8_160_160	()
#define __EQ8_161_161	()
#define __EQ8_162_162	()
#define __EQ8_163_163	()
#define __EQ8_164_164	()
#define __EQ8_165_165	()
#define __EQ8_166_166	()
#define __EQ8_167_167	()
#define __EQ8_168_168	()
#define __EQ8_169_169	()
#define __EQ8_170_170	()
#define __EQ8_171_171	()
#define __EQ8_172_172	()
#define __EQ8_173_173	()
#define __EQ8_174_174	()
#define __EQ8_175_175	()
#define __EQ8_176_176	()
#define __EQ8_177_177	()
#define __EQ8_178_178	()
#define __EQ8_179_179	()
#define __EQ8_180_180	()
#define __EQ8_181_181	()
#define __EQ8_182_182	()
#define __EQ8_183_183	()
#define __EQ8_184_184	()
#define __EQ8_185_185	()
#define __EQ8_186_186	()
#define __EQ8_187_187	()
#define __EQ8_188_188	()
#define __EQ8_189_189	()
#define __EQ8_190_190	()
#define __EQ8_191_191	()
#define __EQ8_192_192	()
#define __EQ8_193_193	()
#define __EQ8_194_194	()
#define __EQ8_195_195	()
#define __EQ8_196_196	()
#define __EQ8_197_197	()
#define __EQ8_198_198	()
#define __EQ8_199_199	()
#define __EQ8_200_200	()
#define __EQ8_201_201	()
#define __EQ8_202_202	()
#define __EQ8_203_203	()
#define __EQ8_204_204	()
#define __EQ8_205_205	()
#define __EQ8_206_206	()
#define __EQ8_207_207	()
#define __EQ8_208_208	()
#define __EQ8_209_209	()
#define __EQ8_210_210	()
#define __EQ8_211_211	()
#define __EQ8_212_212	()
#define __EQ8_213_213	()
#define __EQ8_214_214	()
#define __EQ8_215_215	()
#define __EQ8_216_216	()
#define __EQ8_217_217	()
#define __EQ8_218_218	()
#define __EQ8_219_219	()
#define __EQ8_220_220	()
#define __EQ8_221_221	()
#define __EQ8_222_222	()
#define __EQ8_223_223	()
#define __EQ8_224_224	()
#define __EQ8_225_225	()
#define __EQ8_226_226	()
#define __EQ8_227_227	()
#define __EQ8_228_228	()
#define __EQ8_229_229	()
#define __EQ8_230_230	()
#define __EQ8_231_231	()
#define __EQ8_232_232	()
#define __EQ8_233_233	()
#define __EQ8_234_234	()
#define __EQ8_235_235	()
#define __EQ8_236_236	()
#define __EQ8_237_237	()
#define __EQ8_238_238	()
#define __EQ8_239_239	()
#define __EQ8_240_240	()
#define __EQ8_241_241	()
#define __EQ8_242_242	()
#define __EQ8_243_243	()
#define __EQ8_244_244	()
#define __EQ8_245_245	()
#define __EQ8_246_246	()
#define __EQ8_247_247	()
#define __EQ8_248_248	()
#define __EQ8_249_249	()
#define __EQ8_250_250	()
#define __EQ8_251_251	()
#define __EQ8_252_252	()
#define __EQ8_253_253	()
#define __EQ8_254_254	()
#define __EQ8_255_255	()


/* 如何定义小于呢? 递归? */


// #define MAX8		(256)
// #define BITNR8(n)	__MCAT(__BITNR_,n)


// #define __BITNR_256	(8)
// #define __BITNR_128	(7)
// #define __BITNR_64	(6)
// #define __BITNR_32	(5)
// #define __BITNR_16	(4)
// #define __BITNR_8	(3)
// #define __BITNR_4	(2)
// #define __BITNR_2	(1)
// #define __BITNR_1	(0)



